package com.lcq.study.test.demo.controller;

import com.lcq.study.test.demo.entity.People;
import com.lcq.study.test.demo.service.CacheService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @ClassName HelloController
 * @Description
 * @Author lichuanqi
 * @Date 2022/5/12 11:56
 * @Version 1.0
 **/
@RestController
@RequestMapping("/cache")
public class CacheController {
    @Resource
    private CacheService cacheService;

    @GetMapping("/cache-create")
    public String createCache(){
        return cacheService.createCache();
    }

    @GetMapping("/people")
    public People people(){
        return cacheService.people();
    }

    @GetMapping("/people-delete")
    public void deletePeople(){
        cacheService.deletePeople();
    }

    @GetMapping("/cache-delete")
    public void deleteCache(){
        cacheService.deleteCache();
    }

    @GetMapping("/cache-create1")
    public String createCache1(){
        return cacheService.createCache1();
    }


}
